import request from '@/utils/request'
import data from '../../views/system/dict/data.vue'

// 查询损耗记录列表
export function listStoDec(query) {
  return request({
    url: '/stock/decrease/list',
    method: 'get',
    params: query
  })
}

// 查询损耗记录详细
export function getStoDec(decreaseId) {
  return request({
    url: '/stock/decrease/' + decreaseId,
    method: 'get'
  })
}

// 新增损耗记录
export function addStoDec(data) {
  return request({
    url: '/stock/decrease',
    method: 'post',
    data: data
  })
}

// 修改损耗记录
export function updateStoDec(data) {
  return request({
    url: '/stock/decrease',
    method: 'put',
    data: data
  })
}

// 删除损耗记录
export function delStoDec(decreaseId) {
  return request({
    url: '/stock/decrease/' + decreaseId,
    method: 'delete'
  })
}

// 确认损耗记录
export function confirmStoDec(data) {
  return request({
    url: '/stock/decrease/approve',
    method: 'post',
    data: data
  })
}

